#include <bits/stdc++.h>
#define iter set<int>::iterator
using namespace std;

int n;
int r[100005],atkd[100005];
int b[100005],st[100005];
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	set<int> s,atk;
	vector<int> ari;
	for(int i=1;i<=n;i++){
		cin>>r[i];
		b[r[i]]++;
		atkd[r[i]]++;
		s.insert(r[i]);
		atk.insert(r[i]);
	}
/*	sort(r+1,r+n+1);
	for(int i=1;i<=100005;i++){
		if(b[i]!=0){
			ari.push_back(i);
		}
		if(st[r[i]]==0){
			st[r[i]]=i;
		}_
	}*/
	set<int>::iterator it;
/*	for(int i=1;i<=n;i++){
		int from;
		
		
		
	}*/
//	int tatsu=0;
	for(it=s.begin();it!=s.end();it=s.upper_bound(*it)){
		int vis=*it;
		atk.erase(vis);
//		printf("normal,now visiting%d\n",vis);
		do{
			iter sup=atk.upper_bound(vis);
			if(*sup>vis){
				if(atkd[*sup]>0) atkd[*sup]--;
				if(b[vis]>0) {
					b[vis]--;
//					printf("one kill one with %d:%d!\n",*sup,vis);
				}
				if(atkd[*sup]<=0){
					atk.erase(*sup);
//					printf("%d could not attack%d\n",*sup,atkd[*sup]);
				}
				if(b[vis]<=0){
//					printf("%d range %d life\n",vis,b[vis]);
					s.erase(*it);
					atk.erase(*it);
				}
			}
//			cout<<atk.size();
//			tatsu++;
//			if(tatsu>=50)break;
			if(atk.empty())break;
			else continue;	
		}while(b[vis]>0);
	}
	int cnt=0;
	for(int i=1;i<=100005;i++){
		cnt+=b[i];
	}
	cout<<cnt;
	return 0;
}
